﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Dashboard.aspx.cs" Inherits="Dashboard" Title="" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="content">
    <table style="width: 100%">
        <tr>
            <td style="width: 50%">
                <div style="min-height: 240px">
                    <asp:Label ID="labServices" runat="server" Width="100%" Text="Services" BackColor="#5D7B9D"
                        Font-Bold="True" Font-Overline="False" ForeColor="White" />
                    <asp:Panel ID="pnServices" runat="server" Width="100%">
                        <asp:ListView ID="lvServices" runat="server">
                            <LayoutTemplate>
                                <table style="width: 100%" cellspacing="0" cellpadding="4">
                                    <thead>
                                        <tr>
                                            <th>
                                                Service
                                            </th>
                                            <th>
                                                Status
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr id="itemPlaceholder" runat="server" />
                                    </tbody>
                                </table>
                            </LayoutTemplate>
                            <AlternatingItemTemplate>
                                <tr>
                                    <td class="item2">
                                        <asp:Image ID="imgService" runat="server" ImageUrl='<%#Eval("Status","~/Images/Services/{0}.JPG")%>' />
                                        <%#Eval("DisplayName") %>
                                    </td>
                                    <td class="item2">
                                        <%#Eval("Status") %>
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td class="item">
                                        <asp:Image ID="imgService" runat="server" ImageUrl='<%#Eval("Status","~/Images/Services/{0}.JPG")%>' />
                                        <%#Eval("DisplayName") %>
                                    </td>
                                    <td class="item">
                                        <%#Eval("Status") %>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:ListView>
                    </asp:Panel>
                </div>
            </td>
            <td style="width: 50%">
                <div style="min-height: 240px">
                    <asp:Label ID="labEventLogs" runat="server" Text="Event logs" BackColor="#5D7B9D"
                        Font-Bold="True" ForeColor="White" Width="100%" />
                    <asp:Panel ID="pnEventLogs" runat="server">
                        <asp:ListView ID="lvEventLogs" runat="server">
                            <LayoutTemplate>
                                <table style="width: 100%" cellspacing="0" cellpadding="4">
                                    <thead>
                                        <tr>
                                            <th>
                                                Name
                                            </th>
                                            <th>
                                                Errors
                                            </th>
                                            <th>
                                                Warnings
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr id="itemPlaceholder" runat="server" />
                                    </tbody>
                                </table>
                            </LayoutTemplate>
                            <AlternatingItemTemplate>
                                <tr>
                                    <td class="item2">
                                        <asp:Image ID="imgService" runat="server" ImageUrl='<%# GetEventLogStateImage(Container.DataItem) %>' />
                                        <%#Eval("Name") %>
                                    </td>
                                    <td class="item2">
                                        <%#Eval("Errors") %>
                                    </td>
                                    <td class="item2">
                                        <%#Eval("Warnings") %>
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td class="item">
                                        <asp:Image ID="imgService" runat="server" ImageUrl='<%# GetEventLogStateImage(Container.DataItem) %>' />
                                        <%#Eval("Name") %>
                                    </td>
                                    <td class="item">
                                        <%#Eval("Errors") %>
                                    </td>
                                    <td class="item">
                                        <%#Eval("Warnings") %>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:ListView>
                    </asp:Panel>
                </div>
            </td>
        </tr>
        <tr>
            <td style="width: 50%">
                <div style="min-height: 240px">
                    <asp:Label ID="labDisks" runat="server" Width="100%" Text="Disks" BackColor="#5D7B9D"
                        Font-Bold="True" Font-Overline="False" ForeColor="White" />
                    <asp:Panel ID="pnDisks" runat="server">
                    <asp:ListView ID="lvDisks" runat="server">
                            <LayoutTemplate>
                                <table style="width: 100%" cellspacing="0" cellpadding="4">
                                    <thead>
                                        <tr>
                                            <th>
                                                Disk
                                            </th>
                                            <th>
                                                Label
                                            </th>
                                            <th>
                                                File system
                                            </th>
                                            <th>
                                                Free [MB]
                                            </th>
                                            <th>
                                            % Free
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr id="itemPlaceholder" runat="server" />
                                    </tbody>
                                </table>
                            </LayoutTemplate>
                            <AlternatingItemTemplate>
                                <tr>
                                    <td class="item2">
                                        <asp:Image ID="imgService" runat="server" ImageUrl='<%#Eval("State","~/Images/Disks/{0}.JPG")%>' />
                                        <%#Eval("Root") %>
                                    </td>
                                    <td class="item2">
                                        <%#Eval("VolumeName")%>
                                    </td>
                                    <td class="item2">
                                        <%#Eval("FileSystem")%>
                                    </td>
                                    <td class="item2">
                                    <%#Eval("FreeSpaceMB") %>
                                    </td>
                                    <td class="item2">
                                    <%#Eval("ProcentageFree","{0:g2}%") %>
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td class="item">
                                        <asp:Image ID="imgService" runat="server" ImageUrl='<%#Eval("State","~/Images/Disks/{0}.JPG")%>' />
                                        <%#Eval("Root") %>
                                    </td>
                                    <td class="item">
                                        <%#Eval("VolumeName")%>
                                    </td>
                                    <td class="item">
                                        <%#Eval("FileSystem")%>
                                    </td>
                                    <td class="item">
                                    <%#Eval("FreeSpaceMB") %>
                                    </td>
                                    <td class="item">
                                    <%#Eval("ProcentageFree","{0:g2}%") %>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:ListView>                        
                    </asp:Panel>
                </div>
            </td>
            <td style="width: 50%; vertical-align: top">
                <div style="min-height: 240px">
                    <asp:Label ID="labSysInfo" runat="server" Width="100%" Text="System info" BackColor="#5D7B9D"
                        Font-Bold="True" Font-Overline="False" ForeColor="White" />
                    <asp:Panel ID="pnSysInfo" runat="server">
                        <table style="width: 100%" cellspacing="0" cellpadding="4">
                            <tr style="background-color: #EFF3FB">
                                <td class="style1">
                                    Operating system
                                </td>
                                <td>
                                    <asp:Label ID="labOS" runat="server" Text="Label"></asp:Label>
                                </td>
                            </tr>
                            <tr style="background-color: White">
                                <td class="style1">
                                    Host name
                                </td>
                                <td>
                                    <asp:Label ID="labHost" runat="server" Text="Label"></asp:Label>
                                </td>
                            </tr>
                            <tr style="background-color: #EFF3FB">
                                <td class="style1">
                                    Uptime
                                </td>
                                <td>
                                    <asp:Label ID="labUptime" runat="server" Text="Label"></asp:Label>
                                </td>
                            </tr>
                            <tr style="background-color: White">
                                <td class="style1">
                                    Processes
                                </td>
                                <td>
                                    <asp:Label ID="labProcesses" runat="server" Text="Label"></asp:Label>
                                </td>
                            </tr>
                            <tr style="background-color: #EFF3FB">
                                <td class="style1">
                                    Network available
                                </td>
                                <td>
                                    <asp:CheckBox ID="cbNetwork" runat="server" Enabled="false" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
            </td>
        </tr>
    </table>
    <cc1:CollapsiblePanelExtender ID="cpeServices" runat="server" TargetControlID="pnServices"
        CollapseControlID="labServices" ExpandControlID="labServices">
    </cc1:CollapsiblePanelExtender>
    <cc1:CollapsiblePanelExtender ID="cpeEventLogs" runat="server" CollapseControlID="labEventLogs"
        ExpandControlID="labEventLogs" TargetControlID="pnEventLogs">
    </cc1:CollapsiblePanelExtender>
    <cc1:CollapsiblePanelExtender ID="cpeDisks" runat="server" CollapseControlID="labDisks"
        ExpandControlID="labDisks" TargetControlID="pnDisks">
    </cc1:CollapsiblePanelExtender>
    <cc1:CollapsiblePanelExtender ID="cpeSysInfo" runat="server" CollapseControlID="labSysInfo"
        ExpandControlID="labSysInfo" TargetControlID="pnSysInfo">
    </cc1:CollapsiblePanelExtender>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="head">
    <style type="text/css">
        .style1
        {
            width: 113px;
        }
        td.item
        {
            background-color: #EFF3FB;
        }
        td.item2
        {
            background-color: White;
            color: #284775;
        }
        thead > tr
        {
            background-color: #5D7B9D;
            font-weight: bold;
            color: White;
        }
    </style>
</asp:Content>
